package dao;

import java.sql.*;

public class Login_check {

    public static boolean log_check(String account, String password) {
        MyConnection myCon = new MyConnection();
        myCon.getConnection();
        boolean st = false;
        try {
            PreparedStatement ps = myCon.connection.prepareStatement("SELECT * FROM admin where adminaccount=? and adminPassword=?");
            ps.setString(1, account);
            ps.setString(2, password);
            ResultSet rs = ps.executeQuery();
            while (rs.next()) {
                st = true;
            }
            ps.close();

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            myCon.closeConnection();
        }
        return st;
    }
}
